package com.runen.wnhz.runen.presenter.iPresenter;

import com.runen.wnhz.runen.common.utils.ToastUtil;
import com.runen.wnhz.runen.data.entity.MyEvaluationBean;
import com.runen.wnhz.runen.presenter.BasePresenter;
import com.runen.wnhz.runen.presenter.Contart.EvaluationContart;
import com.runen.wnhz.runen.presenter.Contart.QuestionInfoContart;
import com.runen.wnhz.runen.presenter.model.EvaluationModel;
import com.runen.wnhz.runen.presenter.model.QuestionInfoModel;

import java.util.HashMap;
import java.util.Map;

import javax.inject.Inject;

import rx.android.schedulers.AndroidSchedulers;
import rx.functions.Action1;
import rx.schedulers.Schedulers;

/**
 * NAME：薛世杰
 * DATE：2018/5/2
 * EMIAL：zenhac@163.com
 * DESCRIBE：
 */


public class IQuestionInfoPersenter extends BasePresenter<QuestionInfoModel,QuestionInfoContart.View> {

    @Inject
    public IQuestionInfoPersenter(QuestionInfoModel mModel, QuestionInfoContart.View mView) {
        super(mModel, mView);
    }

/*
    //获取我的测评记录
    public void getContent(){

        Map<String,String> map = new HashMap<>();

        map.put("token", mView.getToken());
        *//*map.put("ttid",mView.getPage());
        map.put("ltid",)*//*


        mModel.getContent(map).subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new Action1<MyEvaluationBean>() {
                    @Override
                    public void call(MyEvaluationBean myEvaluationEntity) {
                        switch (myEvaluationEntity.getReX()){
                            case -1:
                                mView.onTokenError(myEvaluationEntity.getInfo());
                                break;
                            case 0:
                                mView.showErrorMessage(myEvaluationEntity.getInfo());
                                break;
                            case 1:
                                mView.onSuccess(myEvaluationEntity);
                                break;
                        }
                    }
                }, new Action1<Throwable>() {
                    @Override
                    public void call(Throwable throwable) {
                        ToastUtil.showToast(throwable.getMessage());
                    }
                });
    }*/
}
